//
//  DefineFile.hpp
//  learnC++
//
//  Created by liuzhibing on 2018/9/14.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#ifndef DefineFile_hpp
#define DefineFile_hpp

#include <stdio.h>
/*
template <class INTERNAL_CLASS>
class c##ProxyWithInternal;
typedef c##ProxyWithInternal<c##Interface> c##Proxy;


template <class INTERNAL_CLASS>
class c##ProxyWithInternal : public c##Interface {
protected:
    typedef c##Interface C;
public:
    const INTERNAL_CLASS* internal() const { return c_; }
    INTERNAL_CLASS* internal() { return c_; }
    
    
    
protected:
    c##ProxyWithInternal(rtc::Thread* signaling_thread,
                         rtc::Thread* worker_thread, INTERNAL_CLASS* c)
    : signaling_thread_(signaling_thread),
    worker_thread_(worker_thread),
    c_(c) {}
    
private:
    mutable rtc::Thread* signaling_thread_;
    mutable rtc::Thread* worker_thread_;
public:
    ~c##ProxyWithInternal() {
        MethodCall0<c##ProxyWithInternal, void> call(
                                                     this, &c##ProxyWithInternal::DestroyInternal);
        call.Marshal(RTC_FROM_HERE, destructor_thread());
    }
private:
    void DestroyInternal() { delete c_; }
    INTERNAL_CLASS* c_;
    
public:
static std::unique_ptr<c##Interface> Create(
                                            rtc::Thread* signaling_thread, rtc::Thread* worker_thread,
                                            std::unique_ptr<INTERNAL_CLASS> c) {
    return std::unique_ptr<c##Interface>(new c##ProxyWithInternal(
                                                                  signaling_thread, worker_thread, c.release()));
}
    
private:
    rtc::Thread* destructor_thread() const { return signaling_thread_; }
public:
*/
 
#endif /* DefineFile_hpp */
